home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1989 / May 89 / U0009-Re Later versions o-May89 < prev    next >
Encoding:
Text File  |  1991-03-06  |  1.5 KB  |  49 lines  |  [TEXT/GEOL]

  1. Item    9118910                         4-May-89        09:25
  2.  
  3. From:   KNEPPER                         Knepper, Christopher
  4.  
  5. To:     CH0095                          CH DEV PEMD Group
  6.  
  7. cc:     MACAPP.TECH$                    MACAPP Tech
  8.  
  9. Sub:    Response to Later versions of
  10.  
  11. Hi Ernie,
  12.  
  13. >How can any of these constants be increased so that the application can read
  14. >files created when the constants were smaller?
  15.  
  16. Why not include a data file version number as the first byte of the data file?
  17. This way, your DoRead method could check the first byte (ie the version number)
  18. of the data file and determine which data structure to use when reading data
  19. from the file based on the version number of the data file.
  20.  
  21. If the version number (byte) were 1, you would use your original data
  22. structure, if the version number (byte) were 2, you would use the next
  23. version's data structure.
  24.  
  25. In this mechanism, you would need to include the original code for DoRead (and
  26. the original constants) as well as include all subsequent versions' code for
  27. DoRead (and their constants).
  28.  
  29. You might redefine your constants as:
  30.  
  31. kMaxVariablenameLength     {original constant value}
  32.  
  33. k2MaxVariablenameLength    {2nd version constant value}
  34.  
  35. k3MaxVariablenameLength    {3rd version constant value}
  36.  
  37. etc.
  38.  
  39. ourApp would have _all_ the constants for each version of the data file, rather
  40. than just the latest and greates values.
  41.  
  42. This is roughly similar to the way in which PICT files version numbering works.
  43.  
  44. Good luck,
  45. -Chris
  46. (another faceless dweeb)
  47.  
  48.  
  49.